
<%@ page import="ch.vd.dec.selt.petale.Prestation" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title><g:message code="prestation.edit" default="Edit Prestation" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}"><g:message code="home" default="Home" /></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="prestation.list" default="Prestation List" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="prestation.new" default="New Prestation" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="prestation.edit" default="Edit Prestation" /></h1>
            <g:if test="${flash.message}">
            <div class="message"><g:message code="${flash.message}" args="${flash.args}" default="${flash.defaultMessage}" /></div>
            </g:if>
            <g:hasErrors bean="${prestationInstance}">
            <div class="errors">
                <g:renderErrors bean="${prestationInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${prestationInstance?.id}" />
                <g:hiddenField name="version" value="${prestationInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name"><g:message code="prestation.name" default="Name" />:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: prestationInstance, field: 'name', 'errors')}">
                                    <g:textArea name="name" rows="5" cols="40" value="${fieldValue(bean: prestationInstance, field: 'name')}" />

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="abbr"><g:message code="prestation.abbr" default="Abbr" />:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: prestationInstance, field: 'abbr', 'errors')}">
                                    <g:textField name="abbr" maxlength="20" value="${fieldValue(bean: prestationInstance, field: 'abbr')}" />

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="type"><g:message code="prestation.type" default="Type" />:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: prestationInstance, field: 'type', 'errors')}">
                                    <g:select name="type.id" from="${ch.vd.dec.selt.petale.TypePrestation.list()}" optionKey="id" value="${prestationInstance?.type?.id}"  />

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="priority"><g:message code="prestation.priority" default="Priority" />:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: prestationInstance, field: 'priority', 'errors')}">
                                    <g:textField name="priority" value="${fieldValue(bean: prestationInstance, field: 'priority')}" />

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="header"><g:message code="prestation.header" default="Header" />:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: prestationInstance, field: 'header', 'errors')}">
                                    <g:textArea name="header" rows="5" cols="40" value="${fieldValue(bean: prestationInstance, field: 'header')}" />

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="footer"><g:message code="prestation.footer" default="Footer" />:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: prestationInstance, field: 'footer', 'errors')}">
                                    <g:textArea name="footer" rows="5" cols="40" value="${fieldValue(bean: prestationInstance, field: 'footer')}" />

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="auto"><g:message code="prestation.auto" default="Auto" />:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: prestationInstance, field: 'auto', 'errors')}">
                                    <g:select name="auto" from="${prestationInstance.constraints.auto.inList}" value="${prestationInstance.auto}" valueMessagePrefix="prestation.auto"  />

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="taxe"><g:message code="prestation.taxe" default="Taxe" />:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: prestationInstance, field: 'taxe', 'errors')}">
                                    <g:select name="taxe" from="${prestationInstance.constraints.taxe.inList}" value="${prestationInstance.taxe}" valueMessagePrefix="prestation.taxe"  />

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="groupes"><g:message code="prestation.groupes" default="Groupes" />:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: prestationInstance, field: 'groupes', 'errors')}">
                                    
<ul>
<g:each in="${prestationInstance?.groupes}" var="groupePrestationInstance">
    <li><g:link controller="groupe" action="show" id="${groupePrestationInstance.groupe.id}">${groupePrestationInstance?.groupe?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="groupePrestation" params="['prestation.id': prestationInstance?.id]" action="create"><g:message code="groupePrestation.new" default="New GroupePrestation" /></g:link>


                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'update', 'default': 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'delete', 'default': 'Delete')}" onclick="return confirm('${message(code: 'delete.confirm', 'default': 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
